using System;
using System.Collections.Generic;
using System.Text;

namespace RapidHDL.Fabric
{
    public class ExternalIOBlock : Block 
    {
        int iWidth;

        public ExternalIOBlock(string psName, int piWidth)
            : base(psName, "EXT_IO")
        {
            iWidth = piWidth;
            this.CreateOutput("OUT", piWidth);
            this.CreateInput("IN", piWidth);
        }

        internal override void GenerateStructure()
        {
            NodeVector nvIO = new NodeVector(ParentComponent, "io_" + sName, iWidth);

            Inputs["IN"].LinkNodeVector(nvIO);
            Outputs["OUT"].LinkNodeVector(nvIO);
        } 
    }
}
